<template>
  <div>
    <el-menu
      default-active="2"
      class="el-menu-vertical-demo navbar-container"
      @open="handleOpen"
      @close="handleClose"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
    >
      <router-link to="/basics">
        <el-menu-item index="1">
          <i class="el-icon-location"></i>

          <span slot="title">基础知识</span>
        </el-menu-item>
      </router-link>
      <router-link to="/vuex">
        <el-menu-item index="2">
          <i class="el-icon-menu"></i>

          <span slot="title">Vuex学习</span>
        </el-menu-item>
      </router-link>

      <router-link to="/router">
        <el-menu-item index="3">
          <i class="el-icon-document"></i>
          <span slot="title">Vue Router</span>
        </el-menu-item>
      </router-link>
      <el-menu-item index="4">
        <i class="el-icon-setting"></i>
        <span slot="title">导航四</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>

<style scoped>
a {
  text-decoration: none;
}
.router-link-active {
  text-decoration: none;
}
.navbar-container {
  min-height: 100%;
}
</style>
